﻿@{
    dynamic userData = ViewBag.MemberData;
    CurrentUser user = (CurrentUser)ViewBag.CurrentUser;
    int bindEmailState = (int)ViewBag.EmailBindState;
    int bindMobileState = (int)ViewBag.MobileBindState;
    string securityLevel = "低";
    if (bindEmailState == 1 && bindMobileState == 1)
    {
        securityLevel = "高";
    }
    else if (bindEmailState == 1 || bindMobileState == 1)
    {
        securityLevel = "中";
    }
}
 <link rel="stylesheet" href="~/Areas/Member/Css/myLogin.css" type="text/css">
<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">账户安全</a></li>
        @*<li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>*@
    </ul>
</div>
<div class="main">
    <div class="account-info clearfix">
        <div class="account-left"><i class="fa fa-user-circle"></i></div>
        <div class="account-body">
            <h3>
                @(user.UserName)
            </h3>
            <p>
                <span>用户组：@ViewBag.MemberGroupName </span>
                @if (!string.IsNullOrEmpty(ViewBag.DepartmentName))
                {<span>&nbsp; &nbsp;部门：@ViewBag.DepartmentName </span>}
            </p>
            <p class="security">
                <i class="fa fa-shield fa-lg"></i><span>安全等级：@securityLevel</span>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <i class="fa fa-envelope fa-lg @(bindEmailState==1?"":"no-bind")"></i><span>@(bindEmailState == 1 ? "已绑定" : "未绑定")</span>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <i class="fa fa-mobile-phone fa-lg fa-2 @(bindMobileState==1?"":"no-bind")"></i><span>@(bindMobileState == 1 ? "已绑定" : "未绑定")</span>
            </p>
        </div>
    </div>

    <div class="panel security-info">
        <div class="panel-heading">账户安全</div>
        <div class="panel-body">
            <table class="table">
                <tr>
                    <td align="center" width="10%">
                        <i class="fa fa-check"></i>
                    </td>
                    <td><strong>登录密码</strong></td>
                    <td width="40%">安全性高的密码可以使帐号更安全,建议您定期更换密码。</td>
                    <td align="center">已设置</td>
                    <td align="center"><a href="@Url.ActionUrl("ModifyPassword")" class="text-blue">修改密码</a></td>
                </tr>
                <tr>
                    <td align="center" width="10%">
                        <i class="fa @(bindEmailState==1?"fa-check":"fa-close")"></i>
                    </td>
                    <td><strong>邮箱绑定</strong></td>
                    <td width="40%">邮箱将是您的最基本账户资料，在保证安全的同时还可以使用邮箱登录。</td>
                    <td align="center">@(bindEmailState == 1 ? "已绑定" : "未绑定")</td>
                    <td align="center"><a href="@Url.ActionUrl("EmailBind")" class="btn btn-sm btn-primary">@(bindEmailState == 1 ? "修改绑定" : "立即绑定")</a></td>
                </tr>
                <tr>
                    <td align="center" width="10%">
                        <i class="fa @(bindMobileState==1?"fa-check":"fa-close")"></i>
                    </td>
                    <td><strong>手机绑定</strong></td>
                    <td width="40%">绑定手机后，您的手机号可以直接用于登录、找回密码等。</td>
                    <td align="center">@(bindMobileState == 1 ? "已绑定" : "未绑定")</td>
                    <td align="center"><a href="@Url.ActionUrl("MobileBind")" class="btn btn-sm btn-primary">@(bindMobileState == 1 ? "修改绑定" : "立即绑定")</a></td>
                </tr>
            </table>
        </div>
    </div>
</div>

